package com.lottery.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lottery.entity.LotteryActivity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface LotteryActivityMapper extends BaseMapper<LotteryActivity> {
    
    /**
     * 查询所有进行中的活动
     */
    @Select("SELECT * FROM lottery_activity WHERE activity_status = 1 " +
            "AND NOW() BETWEEN start_time AND end_time")
    List<LotteryActivity> selectOngoingActivities();
} 